//
//  ElectricInfoViewController.m
//  HuLaQuan
//
//  Created by liyan on 16/1/22.
//  Copyright © 2016年 yuwubao. All rights reserved.
//

#import "ElectricInfoViewController.h"

#import "ZCTradeView.h"

@interface ElectricInfoViewController ()<ZCTradeViewDelegate>

@property (nonatomic,strong) ZCTradeView *tradeView;


@end

@implementation ElectricInfoViewController

- (void)setupChildControllerUI
{
    self.title = @"电费";
    
}

-(void)tapPayButton
{
    self.tradeView =  [[ZCTradeView alloc] initWithTitle:@"请确认支付信息并输入支付密码" andStyle:ZCPresentStyle];
    self.tradeView.delegate = self;
    [self.tradeView showInView:self.view];
}
-(NSString *)finish:(NSString *)pwd{
    NSLog(@"haha %@",pwd);
    
   // [self.passwordAndInfos setObject:pwd forKey:@"checkpassword"];
    
    
    return pwd;
}
-(NSString *)finish:(NSString *)pwd confirm:(BOOL)isConfirm
{
    [self.tradeView cancle];
    
    
    self.shadowView.hidden = NO;
    self.finishView.hidden = NO;
    NSTimer *timerCount = [NSTimer scheduledTimerWithTimeInterval:2
                                                       target:self
                                                     selector:@selector(timerForExit:)
                                                     userInfo:nil
                                                      repeats:NO];
    [[NSRunLoop currentRunLoop] addTimer:timerCount
                                 forMode:NSRunLoopCommonModes];
    return pwd;
}

- (void)timerForExit:(NSTimer *)timer
{
    self.shadowView.hidden = YES;
    self.finishView.hidden = YES;
    
    [timer invalidate];
    [self.navigationController popToRootViewControllerAnimated:YES];
   
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
